# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libksane
pkgver=22.04.3
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x blocked by ktextwidgest, kwallet
arch="all !armhf !s390x !riscv64"
url="https://www.kde.org/applications/graphics/"
pkgdesc="An image scanning library"
license="LGPL-2.1-only OR LGPL-3.0-only"
makedepends="
	extra-cmake-modules
	ki18n-dev
	ktextwidgets-dev
	kwallet-dev
	kwidgetsaddons-dev
	qt5-qtbase-dev
	samurai
	sane-dev
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/libksane-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
10735fe2a1e4edab24a163a395c0f00668b2818961ee89fb906c256fe4ba1d07932e362ea15b89d3fc366037d1aa715d3eed8c9c267f4db4e530e91beb63fe68  libksane-22.04.3.tar.xz
"
